// column
.columns {
  &.is-variable {
    &.is-1_1 {
      --columnGap: 6px;
    }
  }
}

// icon
.icon {
  vertical-align: middle;
  svg {
    display: block;
  }

  &.warn {
    margin-bottom: 2px;

    .qicon {
      color: #fff;
      fill: #f5a623;
    }
  }

  &.icon-clickable:hover {
    .qicon-light {
      color: #324558;
      fill: #b6c2cd;
    }
  }
}

// dropdown
.dropdown {
  &.popper {
    opacity: 0;
    margin-top: -5px;
    transition-property: opacity, margin-top;
    transition-duration: $trans-speed;
    transition-timing-function: cubic-bezier(0.175, 0.35, 0.32, 1);

    &.is-active {
      opacity: 1;
      margin-top: 8px;
    }
  }

  &.dropdown-default {
    .dropdown-content {
      background-color: $dark;
    }

    .menu {
      padding: 8px;
      min-width: 208px;
      border-radius: $border-radius;
      background-color: $dark;
      box-shadow: $btn-default-active-shadow;

      &-item {
        height: auto;
        border-radius: 3px;
        line-height: 20px;
        padding: 6px 19px 6px 12px;
        color: $white;
        font-size: $size-small;
        background-color: transparent;

        &:hover {
          background-color: #36435c;
        }
      }
    }
  }
}

// menu
.menu {
  padding: 8px;
  min-width: 208px;

  &-item {
    height: auto;
    border-radius: 3px;
    font-weight: $font-bold;
    line-height: 20px;
    padding: 8px 22px;
    color: $third-text-color;
    @include ellipsis;

    &:hover {
      background-color: $bg-color;
    }
  }

  .icon {
    margin-right: 12px;
  }

  .qicon {
    vertical-align: initial;
  }
}

.dropdown {
  .menu-label {
    margin: 8px 12px;
    padding: 0;
    line-height: 20px;
    letter-spacing: normal;
    color: $third-text-color;
  }
}

.label {
  font-size: 12px;
}

input.input {
  width: 376px;
  height: auto;
  border-radius: 4px;
  line-height: 20px;
  padding: 6px 12px 4px 12px;
  font-family: $font-family-id;
  font-size: $body-size;
  font-weight: $font-bold;
  border-color: $input-border-color;
  transition: all $trans-speed ease-in-out;
  color: $text-color;
  caret-color: $text-color;

  &::placeholder {
    font-weight: $font-normal;
    color: $placeholder-color;
  }

  &:not([readonly]):not([disabled]):hover {
    border-color: $input-hover-color;
  }

  &:not([readonly]):not([disabled]):focus {
    border-color: $input-focus-color;
    box-shadow: 0 4px 8px 0 rgba(85, 188, 138, 0.2);
  }
}

.input-password {
  max-width: 455px;
}

.textarea {
  font-size: $body-size;
  font-weight: $font-bold;
  font-family: $font-family-id;
  color: $text-color;
  caret-color: $text-color;
  border-radius: 4px;
  border-color: $input-border-color;
  transition: all $trans-speed ease-in-out;
  min-width: auto;

  &::placeholder {
    font-weight: $font-normal;
    color: $placeholder-color;
  }

  &:not([readonly]):not([disabled]):hover {
    border-color: $input-hover-color;
  }

  &:not([readonly]):not([disabled]):focus {
    border-color: $input-focus-color;
    box-shadow: 0 4px 8px 0 rgba(85, 188, 138, 0.2);
  }
}

input[readonly],
textarea[readonly] {
  background-color: #f5f7fa;
}

.breadcrumb:not(:last-child) {
  margin-bottom: 0;
}

.control.has-icons-left .icon,
.control.has-icons-right .icon {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
}

.control.has-icons-left {
  .input {
    padding-left: 40px;
  }

  .icon.is-left {
    left: 12px;
  }
}

.control.has-icons-right {
  .input {
    padding-right: 40px;
  }

  .icon.is-right {
    right: 12px;
  }
}

label.checkbox {
  color: $text-color;
  line-height: 20px;

  &:before {
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    box-shadow: 0 2px 4px 0 rgba(207, 217, 223, 0.8);
  }

  &.checked::after {
    left: 6px;
    top: 4px;
    width: 4px;
    height: 10px;
    border-width: 0 1px 1px 0;
  }

  &.indeterminate::after {
    left: 6px;
    top: 3px;
    width: 4px;
    height: 10px;
    border-width: 0 1px 0px 0;
  }

  input[type='checkbox'] {
    width: 16px;
    height: 16px;
    vertical-align: middle;
  }

  span.label-value {
    padding: 0 12px;
  }
}

// alert
.alert {
  display: block;
  &-icon {
    top: 10px !important;
    left: 10px !important;

    &.icon {
      background-size: 14px !important;
    }
  }

  &-info {
    color: #326e93;

    &.alert-with-description .alert-description {
      color: #326e93;
    }
  }

  .alert-right {
    display: none;
  }
}

.alert.alert-with-description .alert-description {
  margin-top: 0;
  line-height: 1.67;
}

// dropdown
.popper {
  &.dropdown {
    opacity: 0;
    margin-top: -5px;
    transition-property: opacity, margin-top;
    transition-duration: $trans-speed;
    transition-timing-function: cubic-bezier(0.175, 0.35, 0.32, 1);
  }

  &.is-active {
    &.dropdown {
      opacity: 1;
      margin-top: 8px;
    }
  }
}

// select
.select {
  width: 376px;

  .select-menu {
    padding: 0;
    background-color: $dark-color07;
  }

  .select-menu-outer {
    border: none;
  }

  &.select--single {
    .select-menu-outer {
      .select-option {
        font-size: $body-size;
      }
      .is-selected,
      .is-focused {
        background-color: $dark-color06;
        color: white;
      }
    }
  }

  &.is-open {
    .select-control {
      border-color: $primary !important;
      box-shadow: 0 4px 8px 0 rgba(85, 188, 138, 0.36);
    }
  }

  &-option-group {
    padding: 8px;
    .group-title {
      color: $light-color08;
      margin: 4px 0;
      padding: 0;
    }
  }

  &-menu {
    padding: 8px;

    .select-option {
      background-color: #242e42;
      padding: 6px 12px;
      color: $white;
      cursor: pointer;

      &:hover {
        color: $dark-color01;
        font-weight: 500;
      }

      &.is-disabled {
        cursor: not-allowed;
        color: $dark-color01;
      }
    }

    .select-option + .is-selected,
    .select-option + .is-focused {
      background-color: $dark-color06;
      color: white;
    }
  }

  &-control {
    border-color: $input-border-color;

    &:hover {
      border-color: $input-hover-color;
    }
  }

  &-value {
    font-weight: bold;

    .tag {
      background-color: $dark !important;
      color: $white !important;
    }

    &-icon {
      .qicon-dark {
        color: #fff;
        fill: #fff;
      }
    }
  }

  &.is-disabled {
    & > .select-control {
      background-color: $bg-color;

      &:hover {
        background-color: $bg-color;
      }
    }
  }

  .select-option.is-disabled {
    opacity: 1;
  }
}

// recharts
.chart {
  &-light {
    color: $dark !important;
    background-color: $lightest !important;
  }

  &-dark {
    color: $white !important;
    background-color: $dark !important;

    .recharts-cartesian-axis {
      text {
        fill: $grey;
      }
    }

    .recharts-cartesian-grid {
      line {
        stroke: $grey;
      }
    }
  }
}

// charts
.charttip {
  &-title {
    padding-left: 5px;
    margin: 0 0 2px;
    color: $white;
    font-weight: 600;
    line-height: 17px;
  }

  &-content {
    min-width: 120px;
    max-width: 220px;
    font-weight: normal;
    line-height: 17px;

    span {
      position: relative;
      display: block;
      padding: 0 0 0 22px;

      &::before {
        content: '';
        position: absolute;
        top: calc(50% + 1px);
        left: 6px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        transform: translate(0, -50%);
      }

      &.white::before {
        background-color: $white;
      }
      &.default::before {
        background-color: $blue;
      }
      &.totals::before {
        background-color: $white;
        opacity: 0.4;
      }
      &.active::before {
        background-color: $green;
      }
      &.warn::before {
        background-color: $yellow;
      }
      &.danger::before {
        background-color: $red;
      }
      &.total::before {
        background-color: $light;
      }
    }
  }
}

// form
.control {
  font-size: $body-size;
}

// table
.table {
  font-size: $body-size;
  background-color: #ffffff;

  table {
    padding: 0 12px 12px;
  }

  .table-filter-dropdown {
    .dropdown-content {
      max-height: 310px;
      overflow: auto;
    }
  }
}

.table table .table-thead > tr > th {
  padding: 16px 12px;
  color: $second-text-color;
  line-height: 1.67;
  font-weight: 600;
  font-family: $font-family-id;

  .qicon-dark {
    color: $second-text-color;
  }
}

.table .table-tbody > tr > td.table-selection-column .checkbox-wrapper,
.table .table-thead > tr > th.table-selection-column .checkbox-wrapper {
  height: 16px;
  line-height: 16px;
}

.table-title {
  top: 0;
  padding: 8px 20px;
  background-color: $th-bg-color;
  box-shadow: 0 1px 0 0 $second-border-color;
}

.buttons:last-child {
  margin-bottom: 0;
}

.table-filter-bar {
  min-height: 36px;
  border-radius: 18px;
  background-color: $bg-color;
  transition: all $trans-speed ease-in-out;

  &.has-value {
    background-color: #fff;
    border: solid 1px $dark-color01;

    & > .icon.is-right {
      display: block;
    }
  }

  & > .icon.is-left {
    margin: 7px 4px 0 6px;
  }

  & > .icon.is-right {
    display: none;
    width: 56px;
    height: 28px;
    margin-top: 3px;
    margin-right: -4px;
    padding: 6px 20px;
    border-radius: 28px;
    background-color: $bg-color;
  }

  .autosuggest {
    margin-top: 5px;

    .autosuggest-input > input {
      font-size: $body-size;
      background-color: transparent;
    }

    .autosuggest-menu {
      left: 0;
      padding: 4px 0;
      min-width: 208px;
      border: none;
      border-radius: $border-radius;
      background-color: $dark-color06;
      box-shadow: 0 4px 8px 0 rgba(48, 62, 90, 0.2);
      color: $white;
      line-height: 32px;

      & > li {
        font-size: $body-size;
        line-height: 20px;
        padding: 6px 12px;
        cursor: pointer;
        border-radius: 0;
        background-color: $dark-color07;
        &:hover {
          background-color: $dark-color06;
        }

        &.is-active {
          background-color: $dark-color06;
        }
      }
    }
  }

  .table-filter-input.tags .tag {
    height: 28px;
    font-size: $body-size;
    color: #fff !important;
    background-color: $dark !important;

    &.is-rounded,
    &.is-rounded:hover,
    &.is-rounded:focus {
      border: none;
    }

    & > strong {
      color: #fff !important;
    }

    .qicon-dark {
      color: #ffffff;
      fill: #324558;
    }
  }
}

.table-footer {
  margin-top: -1px;
  padding: 16px 20px;
  background-color: $th-bg-color;
  box-shadow: inset 0 1px 0 0 $second-border-color;
  color: $dark-color01;
}

.table .table-tbody > tr > td.table-selection-column > *,
.table .table-thead > tr > th.table-selection-column > * {
  visibility: visible;
}

.table table .table-tbody > tr > td {
  color: $text-color;
  padding: 8px 12px;
  height: 56px;
}

.table-hasSelected > .table-title {
  background-color: $text-color;
}

// message
.meassage-wrapper .message {
  top: 64px !important;
  z-index: 2010;
  font-size: $body-size;
}

.meassage-wrapper .message .notice {
  border-radius: 4px;
  box-shadow: 0 8px 16px 0 rgba(72, 91, 127, 0.2);
  border: none;

  .message-icon {
    width: auto;
    height: auto;
    margin-top: -1px;
    margin-right: 10px;
  }
}

.pagination {
  font-size: $body-size;
}

label.checkbox:before {
  border-radius: 2px;
  box-shadow: none;
  border: solid 1px $light-color07;
}

.radio-group label.radio-button.checked {
  z-index: 0;
}

.textarea:not([rows]) {
  min-height: 64px;
}

.columns:not(:last-child) {
  margin-bottom: 0;
}

.radio-default {
  display: inline-flex !important;
  margin-bottom: 0 !important;
  padding: 1px;
  border-radius: 16px;
  background-color: $card-bg-color;
  border: solid 1px #c1c9d1;

  label.radio-button {
    position: relative;
    font-weight: 500;
    min-width: 117px;
    color: #36435c;
    padding: 4px 24px;
    border-radius: 16px !important;
    border: none;
    background-color: transparent;
    box-shadow: none !important;

    &:hover,
    &:active {
      background-color: transparent;
    }

    &.checked {
      background-color: #36435c;
      color: #ffffff;
    }
  }

  .badge-wrapper {
    @include vertical-center;
    right: 4px;
  }

  &.radio-with-badge {
    label.radio-button {
      padding-right: 44px;
    }
  }
}

// calendar
.flatpickr-calendar {
  &.open {
    z-index: 2000 !important;
  }

  .flatpickr-day {
    font-family: $font-family !important;
  }
}

.upload {
  display: block;
}

.tabs-default {
  .tabs {
    ul {
      border-bottom: none;
    }
  }

  .tabs.is-horizon ul li {
    margin: 0 6px;
    padding: 6px 24px;
    font-size: $size-small;
    font-weight: 500;
    line-height: 1.67;
    color: #5f708a;
    border-radius: 100px;
    border: 1px solid transparent;
    transition: all $trans-speed ease-in-out;

    &:hover {
      background-color: $btn-flat-hover-bg;
      border-color: transparent;
    }

    &:active {
      background-color: $btn-flat-active-bg;
      border-color: transparent;
    }

    &.is-active {
      background-color: $btn-default-bg;
      border-color: $border-color;
    }
  }

  .tab-content .tab-panel.is-active {
    display: block;
  }
}

.tabs-new {
  .tabs {
    display: inline-block;
    ul {
      display: inline-block;
      padding: 1px;
      border: 1px solid $border-color;
      border-radius: 16px;
    }
  }

  .tabs.is-horizon ul li {
    display: inline-block;
    min-width: 100px;
    margin: 0;
    padding: 0 10px;
    font-size: $size-small;
    font-weight: 500;
    line-height: 28px;
    border-radius: 14px;
    border: 0 none;
    text-align: center;
    cursor: pointer;
    transition: all $trans-speed ease-in-out;

    &:hover {
      background-color: $bg-color;
      color: $text-color;
    }

    &:active {
      background-color: $dark;
      color: $white;
    }

    &.is-active {
      background-color: $dark;
      border-color: $white;
      color: $white;
    }
  }

  .tab-content .tab-panel.is-active {
    display: block;
  }
}

.collapse {
  width: 100%;
  border-radius: 0;
  border: none;
  line-height: 1.67;
  font-size: 12px;

  .collapse-item-label {
    font-weight: 600;
    color: #fff;
    box-shadow: 0 1px 0 0 #36435c, 0 -1px 0 0 #36435c;
    background-color: #242e42;
    border: none !important;
    border-radius: 0 !important;

    &.collapse-item-label-border-bottom {
      color: #242e42;
      box-shadow: 0 1px 0 0 #d8dee5, 0 -1px 0 0 #d8dee5;
      background-color: $lightest;
    }
  }

  .collapse-item-content {
    box-shadow: none;
    padding: 12px;
  }

  .collapse-hide {
    padding-top: 0;
    padding-bottom: 0;
  }
}

.ks-tag {
  font-size: $size-small;
  padding: 0 9px;
  border-radius: 1px;
  background-color: #329dce;
  text-shadow: 0 2px 4px rgba(36, 46, 66, 0.1);
  font-weight: 500;
  line-height: 1.33;
  color: #fff;
  cursor: default;

  &-disable {
    background-color: $light-color07;
  }

  & + .ks-tag {
    margin-left: 8px;
  }
}

.badge {
  min-width: 28px;
}

.badge-wrapper > span.badge.is-success {
  background-color: $primary;
}

.alert {
  border: none;
  border-radius: 4px;

  &.alert-warning {
    background-color: #ffe1be;
    color: #654f41;
  }

  &.alert-info {
    background-color: #c7deefa6;
    color: #326e93;
  }
}

.lego-toggles {
  height: 16px;
  min-width: 32px;

  &.checked {
    box-shadow: 0 2px 4px 0 rgba(85, 188, 138, 0.2), inset 0 1px 3px 0 rgba(59, 116, 122, 0.2);

    &::after {
      box-shadow: 0 2px 4px 0 rgba(36, 46, 66, 0.2);
    }
  }

  & > span.text {
    line-height: 16px;
    font-size: 12px;
    font-weight: $font-bold;
    margin-left: 20px;
    margin-right: 8px;

    &.checked {
      margin-left: 8px;
      margin-right: 20px;
    }
  }

  &::after {
    width: 12px;
    height: 12px;
    right: 2px;
    left: 2px;
  }
}

.tooltip {
  &-title {
    margin-bottom: 8px;
    @include TypographySymbolText($white);
  }
  &-desc {
    @include TypographyParagraph($dark-color01);
  }
}
